Optional matches in structural pattern matching